
package se.sll.service.catalogue.gui.api.resource;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Response;
import se.sll.service.catalogue.gui.api.model.MonitorInfo;
import se.sll.service.catalogue.gui.api.support.ResponseWrapper;


/**
 * Handles monitoring of service status
 * 
 */
@Path("monitor")
public interface MonitorService {


    /**
     * Reads the current monitor status
     * 
     */
    @GET
    @Produces({
        "application/json"
    })
    MonitorService.GetMonitorResponse getMonitor()
        throws Exception
    ;

    public class GetMonitorResponse
        extends ResponseWrapper
    {


        private GetMonitorResponse(Response delegate) {
            super(delegate);
        }

        /**
         * The requested Id map was found and is returned in the body. e.g. {
         *   "vmImportFileTimeStamp": "Feb 23, 2014 8:00:01 PM",
         *   "vmImportNumCapacities": "4893",
         *   "vmImportNumIdmap": "416",
         *   "vmImportNumOffers": "488",
         *   "vmImportNumProducts": "166",
         *   "vmImportTimeStamp": "20140224072356"
         * }
         * 
         * 
         * @param entity
         *     {
         *       "vmImportFileTimeStamp": "Feb 23, 2014 8:00:01 PM",
         *       "vmImportNumCapacities": "4893",
         *       "vmImportNumIdmap": "416",
         *       "vmImportNumOffers": "488",
         *       "vmImportNumProducts": "166",
         *       "vmImportTimeStamp": "20140224072356"
         *     }
         *     
         */
        public static MonitorService.GetMonitorResponse jsonOK(MonitorInfo entity) {
            Response.ResponseBuilder responseBuilder = Response.status(200).header("Content-Type", "application/json");
            responseBuilder.entity(entity);
            return new MonitorService.GetMonitorResponse(responseBuilder.build());
        }

    }

}
